using System;

namespace GeneticAlgorithms
{
    /// <summary>
    /// Base interface for genetic algorithms statistics.
    /// </summary>
    /// <remarks>
    /// Please note that the values in the stats are for
    /// reference. Changing the contents of properties such
    /// as RunStatus or population size will cause no effect
    /// on the GA's behaviour.
    /// </remarks>
    public interface IGAStatus
    {
        /// <summary>
        /// Gets or sets the best fitness found so far.
        /// </summary>
        /// <value>A double precision value, indicating the best fitness found so far.</value>
        double BestFitness { get; set; }

        /// <summary>
        /// Gets or sets the population's average fitness.
        /// </summary>
        /// <value>The average fitness.</value>
        double AverageFitness { get; set; }

        /// <summary>
        /// Gets or sets the size of the population.
        /// </summary>
        /// <value>The size of the population.</value>
        /// <remarks>
        /// Setting this value will not cause the population size to grow.
        /// </remarks>
        int PopSize { get; set; }

        /// <summary>
        /// Gets or sets the fitness variance in the current population.
        /// </summary>
        /// <value>The fitness variance in the current population.</value>
        double Variance { get; set; }

        /// <summary>
        /// Gets or sets the fitness variance among generations.
        /// </summary>
        /// <value>The fitness variance among generations.</value>
        double? GenerationVariance { get; set; }

        /// <summary>
        /// Gets or sets the population diversity.
        /// </summary>
        /// <value>The population diversity.</value>
        double Diversity { get; set; }

        /// <summary>
        /// Gets or sets the Algorithm's execution status.
        /// </summary>
        /// <value>The Algorithm's execution status.</value>
        GARunStatus RunStatus { get; set; }

        /// <summary>
        /// Gets or sets the number of elapsed generations.
        /// </summary>
        /// <value>The number of elapsed generations.</value>
        int Generation { get; set; }

        /// <summary>
        /// Gets or sets the elapsed time.
        /// </summary>
        /// <value>The elapsed time.</value>
        TimeSpan ElapsedTime { get; set; }
    }
}
